﻿Imports System.Globalization

Module mdl_method

    Public Function DateSafe(ByVal Value As String) As String
        Dim tmp() As String = Value.Split("/")
        Return tmp(2) & "-" & tmp(1) & "-" & tmp(0)
    End Function

    Public Function NilaiSafe(ByVal Value As String) As String
        Return Value.Replace(",", ".")
    End Function

    Public Function ValidRegional() As Boolean
        Dim current As CultureInfo = My.Application.Culture
        ' Indonesian (Indonesia)

        If current.DisplayName = "Indonesian (Indonesia)" Then
            Return True
        Else
            MsgBox("Anda menggunakan Regional Setting " & current.DisplayName & vbCrLf & "Anda harus mengganti Regional Setting menjadi Indonesian (Indonesia)", MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "Cek Serial")
            Return False
        End If

    End Function

End Module
